<?php

	session_start();
	require("connect.php");
	$link = connect_APO();
	
	if (!session_is_registered('ID')) :
		header('Location: login.php?');
	endif;
	
	require("header+logoutB.php");
	headerL();
	
	$ID=$_SESSION['ID'];
	
	$sql = sprintf("SELECT * From `users` WHERE `ID` = '$ID'");
	$result = mysql_query($sql);
	$row = mysql_fetch_array($result);
	$userID = $row['ID'];
	$userFN = $row['Fname'];
	$userLN = $row['Lname'];
	$userPN = $row['PhoneNumber'];
	$TotCredit = $row['TotCredit'];
	$MC = $row['MC'];
	if($MC==1){
		$MC="Yes";
	} else {
		$MC="No";
	}
	$ML = $row['ML'];
	if($ML==1){
		$ML="Yes";
	} else {
		$ML="No";
	}
	$Status = $row['Status'];
	
	echo "<html>
<body class='main'>

<FONT class='mainFont'>
  <CENTER>
    <!--<p><img src = 'images/apopic.jpg'></p>-->
    <br>
	<br>
	  <div class='headerTable' style='width:500'>
	  <b class='b1f'></b><b class='b2f'></b><b class='b3f'></b><b class='b4f'></b>
	  <div class='contentf'>
		  <div class = 'headerText'>
				Profile:
		  </div>
		  <div id='loginSubmit' style='padding-top:15;'><b>Name:</b> $userFN $userLN</div>
		  <div id='loginSubmit'><b>ID:</b> $userID</div>
		  <div id='loginSubmit'><A href='changePassword.php'>Change Password</A></div>
		  <div id='loginSubmit'><b>Phone Number:</b> $userPN</div>
		  <div id='loginSubmit'><a href='changePhoneNumber.php?error=0'>Change Phone Number</a></div>
		  <div id='loginSubmit'><b>Total Midweek Credit:</b> $TotCredit</div>
		  <div id='loginSubmit'><b>Midweek Coordinator?</b> $MC</div>
		  <div id='loginSubmit'><b>Midweek Leader?</b> $ML</div>
		  <div id='loginSubmit'>$Status</div>
	  </div>
	  <b class='b4f'></b><b class='b3f'></b><b class='b2f'></b><b class='b1f'></b></div>
  </CENTER>
</FONT>
</body>
</html>
";

	require("footer.php");
	footer();

	mysql_close($link);
?>
